#include "StdAfx.h"
#include "GISApplication.h"
#include "Canvas.h"
#include "MapLayerMgr.h"
#include "PanTool.h"

CGISApplication* CGISApplication::m_pGISCurApplication;

CGISApplication::CGISApplication(void)
{
    m_pGISCurApplication = this;
    m_pCanvas = new CCanvas(this);
    m_pMapLayerMgr = new CMapLayerMgr();
	m_pActiveTool = new CPanTool(this);
}

CGISApplication::~CGISApplication(void)
{
    delete m_pCanvas;
    delete m_pMapLayerMgr;
	delete m_pActiveTool;
}

CGISApplication* CGISApplication::getGISApplication()
{
    return m_pGISCurApplication;
}

CString CGISApplication::getApplicationDirectory()
{
    return m_applicationDirectory;
}

void CGISApplication::setApplicationDirectory(CString applicationDirectory)
{
    m_applicationDirectory = applicationDirectory;
}

CString CGISApplication::getSRSDbFilePath()
{
    return m_applicationDirectory + "resources\\qgis.db";
}

CString CGISApplication::getUserDbFilePath()
{
    return m_applicationDirectory + "resources\\srs.db";
}

CCanvas* CGISApplication::getCanvas()
{
    return m_pCanvas;
}

CMapLayerMgr* CGISApplication::getMapLayerMgr()
{
    return m_pMapLayerMgr;
}